package modelLayer;

import java.util.ArrayList;

public class GraphContainer {
	private ArrayList<Flavour> flavourDraw;
	private static GraphContainer instance;
	
	private GraphContainer(){
		flavourDraw = new ArrayList<Flavour>();
	}
	
	public static GraphContainer getInstance(){
		if(instance == null){
			instance = new GraphContainer();
		}
		
		return instance;
	}
	
	public void addToDrawing(Flavour f){
		flavourDraw.add(f);
	}
	
	public void removeFromDrawing(String flavourName){
		for(Flavour f : flavourDraw){
			if(f.getFlavour().equalsIgnoreCase(flavourName)){
				flavourDraw.remove(f);
				break;
			}
		}
	}
	
	public ArrayList<Flavour> getFlavours(){
		return flavourDraw;
	}
	
	public void clear(){
		flavourDraw.clear();
	}

}
